<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"/>
    <title>桥详细页面</title>
    <meta content='width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0, shrink-to-fit=no'
          name='viewport'/>
    <link rel="stylesheet" href="/assets/css/bootstrap.min.css">
    <link rel="stylesheet"
          href="https://fonts.googleapis.com/css?family=Nunito:200,200i,300,300i,400,400i,600,600i,700,700i,800,800i,900,900i">
    <link rel="stylesheet" href="/assets/css/ready.css">
    <link rel="stylesheet" href="/assets/css/demo.css">
    <link rel="stylesheet" href="/assets/css/mystyle.css">
</head>
<body>
<div class="wrapper">
    <div th:replace="~{index::topbar}"></div>
    <div th:replace="~{index::sidebar(activeUri='/bridge/overview')}"></div>
    <div class="main-panel">
        <div class="content">
            <div class="container-fluid">
                <h4 class="page-title" th:text="${bridge.Name}">洪山大桥</h4>
                <div class="row">
                    <!-- <div class="col-md-2">
                        <div class="card" style="height: 730px">
                            <select multiple class="form-control" id="exampleFormControlSelect2" style="height: 730px">
                                <option>1</option>
                                <option>2</option>
                                <option>3</option>
                                <option>4</option>
                                <option>5</option>
                            </select>
                        </div>
                    </div> -->
                    <!--image for bridge-->
                    <div class="col-md-4">
                        <div class="card">
                            <div class="card-header">
                                <div class="card-title text-center">桥概览</div>
                            </div>
                            <div class="card-body">
                                <img src="/assets/img/bridge.jpg" class="card-img">
                            </div>
                        </div>
                    </div>
                    <div class="col-md-8">
                        <div class="card" style="height: 220px">
                            <div class="card-header">
                                <div class="card-title text-center">基本信息</div>
                            </div>
                            <div class="card-body">
                                <table class="table table-hover">
                                    <thead>
                                    <tr>
                                        <th scope="col" class="text-md-center">地区</th>
                                        <th scope="col" class="text-md-center">类型</th>
                                        <th scope="col" class="text-md-center">长度</th>
                                        <th scope="col" class="text-md-center">跨径</th>
                                        <th scope="col" class="text-md-center">使用年限</th>
                                        <th scope="col" class="text-md-center">健康情况</th>
                                    </tr>
                                    <tr>
                                        <th scope="col" class="text-md-center" th:text="${bridge.ID}" hidden="hidden" id="bridgeId">桥ID</th>
                                        <th scope="col" class="text-md-center" th:text="${bridge.DomainID}" id="Domain">地区</th>
                                        <th scope="col" class="text-md-center" th:text="${bridge.Type}" id="Btype">类型</th>
                                        <th scope="col" class="text-md-center" th:text="${bridge.Length}+'KM'" id="BLength">长度</th>
                                        <th scope="col" class="text-md-center" th:text="${bridge.Span}+'KM'" id="BSpan">跨径</th>
                                        <th scope="col" class="text-md-center" th:text="${bridge.UseYears}+'年'" id="BuseYear">使用年限</th>
                                        <th scope="col" class="text-md-center" th:text="${bridge.Health == 1 ?'健康':'预警'}" id="Bhealth">健康</th>
                                    </tr>
                                    </thead>
                                    <tbody>
                                    <tr>
                                        <td class="text-md-center"></td>
                                        <td class="text-md-center"></td>
                                        <td class="text-md-center"></td>
                                        <td class="text-md-center"></td>
                                        <td class="text-md-center"></td>
                                        <td class="text-md-center"></td>
                                        <td class="text-md-center"></td>
                                    </tr>


                                    </tbody>
                                </table>
                            </div>
                        </div>
                    </div>
                    <div class="col-md-12">
                        <div class="card">
                            <div class="card-header">
                                <div class="card-title text-center">传感器信息</div>
                            </div>
                            <div class="card-body" style="overflow-y: scroll;height: 400px">
                                <table class="table table-hover">
                                    <thead>
                                    <tr>
                                        <th scope="col" class="text-md-center">ID</th>
                                        <th scope="col" class="text-md-center">名称</th>
                                        <th scope="col" class="text-md-center">类型</th>
                                        <th scope="col" class="text-md-center">单位</th>
                                        <th scope="col" class="text-md-center">位置标号</th>
                                        <th scope="col" class="text-md-center">是否显示（js）</th>
                                    </tr>
                                    </thead>
                                    <tbody>
                                    <tr th:each="sensor,sensorStat:${sensors}">
                                        <td class="text-md-center" th:text="${sensor.ID}"></td>
                                        <td class="text-md-center" th:text="${sensor.cdName}"></td>
                                        <td class="text-md-center" th:text="${sensor.paraTypeCode}"></td>
                                        <td class="text-md-center" th:text="${sensor.paraUnit}"></td>
                                        <td class="text-md-center" th:text="${sensor.dictOrder}"></td>
                                        <td class="text-md-center"><button type="button" value="显示实时数据" class="btn btn-primary" th:data-paraid="${sensor.paraId}" th:data-cdName="${sensor.cdName}" onclick="showdata(this.getAttribute('data-paraid'),this.getAttribute('data-cdName'));">显示实时数据</button></td>
                                    </tr>
                                    </tbody>
                                </table>
                            </div>
                        </div>
                    </div>
                </div>
                <!--Real time data show-->
                <div class="row" id="realtimeData">
                    <!--<div class="col-md-6">-->
                        <!--<div class="card">-->
                            <!--<div class="card-header">-->
                                <!--<div class="text-md-center">-->
                                    <!--<p class="card-title">HM-VWS-21</p>-->
                                <!--</div>-->
                            <!--</div>-->
                            <!--<div class="card-body">-->
                                <!--<div id="box" style="width: 100%; height:300px;"></div>-->
                            <!--</div>-->
                        <!--</div>-->
                    <!--</div>-->
                </div>
                <!--WarningData-->
                <div class="row">
                    <div class="col-md-12">
                        <div class="card">
                            <div class="card-header">
                                <div class="card-title text-center ">异常数据值</div>
                                <div class="col-md-8">
                                    选择查看传感器：
                                    <select class="form-control input-fixed" id="sensor_group">
                                        <option value="0" selected>所有传感器</option>
                                        <option th:each="csensor,iterStat:${sensors}" th:value="${csensor.paraId}" th:text="${csensor.cdName}">洪山区</option>
                                    </select>
                                </div>
                            </div>
                            <div class="card-body" style="overflow-y: scroll;height: 400px">
                                <table class="table table-hover" id="WarningDataT">
                                    <thead>
                                    <tr id="WarningDataTitle">
                                        <th scope="col" class="text-md-center">ID</th>
                                        <th scope="col" class="text-md-center">数值</th>
                                        <th scope="col" class="text-md-center">单位编号</th>
                                        <th scope="col" class="text-md-center">一级阈值</th>
                                        <th scope="col" class="text-md-center">二级阈值</th>
                                        <th scope="col" class="text-md-center">时间</th>
                                    </tr>
                                    </thead>
                                    <tbody id="WarningDataBody">
                                    <tr>
                                        <td class="text-md-center"></td>
                                        <td class="text-md-center"></td>
                                        <td class="text-md-center"></td>
                                        <td class="text-md-center"></td>
                                        <td class="text-md-center"></td>
                                    </tr>
                                    </tbody>
                                </table>
                            </div>
                        </div>
                    </div>
                </div>
                <div class="row">
                    <div class="col-md-12">
                        <div class="card">
                            <div class="card-header">
                                <div class="card-title text-center">预警信息</div>
                            </div>
                            <div class="card-body" style="overflow-y: scroll;height: 400px">
                                <table class="table table-hover">
                                    <thead>
                                    <tr>
                                        <th scope="col" class="text-md-center">ID</th>
                                        <th scope="col" class="text-md-center">预警类型</th>
                                        <th scope="col" class="text-md-center">传感器名称</th>
                                        <th scope="col" class="text-md-center">预警水平</th>
                                        <th scope="col" class="text-md-center">时间</th>
                                        <th scope="col" class="text-md-center">操作</th>
                                    </tr>
                                    </thead>
                                    <tbody id="EarlyWarningBody">
                                    <tr>
                                        <td class="text-md-center"></td>
                                        <td class="text-md-center"></td>
                                        <td class="text-md-center"></td>
                                        <td class="text-md-center"></td>
                                        <td class="text-md-center"></td>
                                    </tr>
                                    </tbody>
                                </table>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
            <div th:replace="~{index::footer}"></div>
        </div>
    </div>
</div>
<!-- Modal -->
<div class="modal fade" id="modalUpdate" tabindex="-1" role="dialog" aria-labelledby="modalUpdatePro"
     aria-hidden="true">
    <div class="modal-dialog modal-dialog-centered" role="document">
        <div class="modal-content">
            <div class="modal-header bg-primary">
                <h6 class="modal-title"><i class="la la-frown-o"></i> Under Development</h6>
                <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                    <span aria-hidden="true">&times;</span>
                </button>
            </div>
            <div class="modal-body text-center">
                <p>Currently the pro version of the <b>Ready Dashboard</b> Bootstrap is in progress development</p>
                <p>
                    <b>We'll let you know when it's done</b></p>
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>
            </div>
        </div>
    </div>
</div>
</body>
<script src="/assets/js/core/jquery.3.2.1.min.js"></script>
<script src="/assets/js/plugin/jquery-ui-1.12.1.custom/jquery-ui.min.js"></script>
<script src="/assets/js/core/popper.min.js"></script>
<script src="/assets/js/core/bootstrap.min.js"></script>
<script src="/assets/js/plugin/chartist/chartist.min.js"></script>
<script src="/assets/js/plugin/chartist/plugin/chartist-plugin-tooltip.min.js"></script>
<script src="/assets/js/plugin/bootstrap-notify/bootstrap-notify.min.js"></script>
<script src="/assets/js/plugin/bootstrap-toggle/bootstrap-toggle.min.js"></script>
<script src="/assets/js/plugin/jquery-mapael/jquery.mapael.min.js"></script>
<script src="/assets/js/plugin/jquery-mapael/maps/world_countries.min.js"></script>
<script src="/assets/js/plugin/chart-circle/circles.min.js"></script>
<script src="/assets/js/plugin/jquery-scrollbar/jquery.scrollbar.min.js"></script>
<script src="/assets/js/echarts.min.js"></script>
<script src="/assets/js/ready.min.js"></script>
<script src="/assets/js/showbridge.js"></script>
<script src="/assets/js/demo.js"></script>

<script language="JavaScript">
    //获取到这个DOM节点，然后初始化

    // var myChart = echarts.init(document.getElementById("box"));

    // // option 里面的内容基本涵盖你要画的图表的所有内容
    // var option = {
    //     // 定义样式和数据
    //     title : {
    //         text: '未来一周气温变化',
    //         subtext: '纯属虚构'
    //     },
    //     tooltip : {
    //         trigger: 'axis'
    //     },
    //     legend: {
    //         data:['最高气温','最低气温']
    //     },
    //     toolbox: {
    //         show : true,
    //         feature : {
    //             mark : {show: true},
    //             dataView : {show: true, readOnly: false},
    //             magicType : {show: true, type: ['line', 'bar']},
    //             restore : {show: true},
    //             saveAsImage : {show: true}
    //         }
    //     },
    //     calculable : true,
    //     xAxis : [
    //         {
    //             type : 'category',
    //             boundaryGap : false,
    //             data : ['周一','周二','周三','周四','周五','周六','周日']
    //         }
    //     ],
    //     yAxis : [
    //         {
    //             type : 'value',
    //             axisLabel : {
    //                 formatter: '{value} °C'
    //             }
    //         }
    //     ],
    //     series : [
    //         {
    //             name:'最高气温',
    //             type:'line',
    //             data:[11, 11, 15, 13, 12, 13, 10],
    //             markPoint : {
    //                 data : [
    //                     {type : 'max', name: '最大值'},
    //                     {type : 'min', name: '最小值'}
    //                 ]
    //             },
    //             markLine : {
    //                 data : [
    //                     {type : 'average', name: '平均值'}
    //                 ]
    //             }
    //         },
    //         {
    //             name:'最低气温',
    //             type:'line',
    //             data:[1, -2, 2, 5, 3, 2, 0],
    //             markPoint : {
    //                 data : [
    //                     {name : '周最低', value : -2, xAxis: 1, yAxis: -1.5}
    //                 ]
    //             },
    //             markLine : {
    //                 data : [
    //                     {type : 'average', name : '平均值'}
    //                 ]
    //             }
    //         }
    //     ]
    // };

    // // 一定不要忘了这个，具体是干啥的我忘了，官网是这样写的使用刚指定的配置项和数据显示图表。
    // myChart.setOption(option);
</script>
</html>